<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<script type="text/javascript">
	$(function() {
		var items;
		var citys;
		 $("#search").click(function() { //按钮单击事件
							//打开文件，并通过回调函数处理获取的数据
							d = new Date(); // 创建 Date 对象。 
							s="temp";
							s += d.getYear() ; // 获取年份。 
							s += d.getMonth()+1 ; // 获取月份。 
							s += d.getDate(); // 获取日。 
							s += d.getHours(); // 获取小时。
							s += d.getMinutes(); // 获取分钟。
							s += d.getSeconds(); // 获取秒数。
							alert(s);
							$('#flightList .ct').remove();
							
							$.ajax({
								type : "Post",
								url : __ctxPath
										+ "/front/order/orderSearch.do?cmd=getApointName&flightName='广州'&arriName='上海'&tempVar="+s,
								dataType : "String",
								async:false,
								success : function(data) {
									citys=eval(data);
								},
								error : function() {
									alert('获取城市名称失败!');
								}
							});
					
							$.ajax({
										type : "GET",
										url : __ctxPath
												+ "/front/order/orderSearch.do?cmd=searchOrder&tempVar="+s,
										dataType : "json",
										success : function(data) {
											items=eval(data);
											alert(items);
											items=data.childNodes;
										
											
											
											
										//	alert(items.childNodes[0].childNodes[0].childNodes);
											alert(items.length);
											var html="";
											var i=1;
											//$(data).find("Item").each(function() { //遍历获取的数据
											//$(data).childNodes[1].childNodes.each(function() {
											 for(var i=1;i<items.length-1;i++){
												//var $item = $(this);
												//var carrier=$item.find("Carrier").text();
												//alert(carrier);
												var carrier=items[i].childNodes[4].childNodes;
												var flight=items[i].childNodes[5].childNodes;
												var duptTime=items[i].childNodes[14].childNodes;
												var ariTime=items[i].childNodes[16].childNodes;
												var boardPoint=items[i].childNodes[8].childNodes;
												var offPoint=items[i].childNodes[9].childNodes;
												for(var city in citys){
													
													if(offPoint==citys[city].name){
															alert(citys[city].name);
															offPoint=citys[city].value;
															break;
													} 
													
												}
												var yPrice=items[i].childNodes[20].childNodes;
												//if(carrier=='CZ'){
													 html+="<div id=\"flightListX"+i+"\" class=\"ct\" style=\"z-index: 600\"  >"
												+"<div class=\"c1\">"
													+"<img src=\"http://source.qunar.com/site/images/airlines/small/CA.gif\"></div>"
												+"<div class=\"c2\">"
													+""+carrier+flight+"<br> <strong>"
														+"<span class=\"s100091\">5</span> </strong></div>"
												 +"<div class=\"c3\">"
												 +"<strong class=\"time1\">"+duptTime+"</strong><br> <strong class=\"time2\">"+ariTime+"</strong></div>"
												 +"<div class=\"c4\">"
												 +""+boardPoint+"<br> "+offPoint+"	</div>"
												 +"<div class=\"c5\">"
												 +"<div class=\"pr\">¥<strong>"+yPrice+"</strong></div>"
												 +"<div class=\"pop_cp\">/"+yPrice+"舱</div>"
												 +"</div>"
												 +"<div class=\"c6\">"
												 +"<div class=\"pop pop_is\" id=\"tgqXI50\">退改签</div>"
												 +"</div>"
												 +"<div class=\"c7\">"+carrier+"</div>"
												 +"<div class=\"c8\"></div>"
												 +"<div class=\"bb\">"
												 +"<button class=\"btn\" id=\"bookingXI"+i+"\">预订</button>"
												 +"<a id=\"showflightListXI50\" class=\"col\" href=\"#\">展开舱位</a>"
												 +"</div>"
												 +"</div>";
											}
											//	}
											//});
											 $('#flightList .hd').after(html);
										},
										error : function() {
											alert('失败!');
										}
									});
						}); 
	});
</script>
<div class="container">
	<div class="leftBar">
		<div class="t_block flightse">
			<div class="hd">
				<div class="wrap2">国内机票搜索</div>
			</div>
			<div class="ct" id="searchPanel">
				<form id="searchForm" method="get"
					action="${ctxPath}/front/order/orderSearch.do">
					<table cellspacing="0" cellpadding="0" class="tbl">
						<tbody>
							<tr>
								<td>航程类型：</td>
								<td><span class="item"><input type="radio" value="1"
										name="flytype" id="onewayTrip" autocomplete="off"
										checked="checked"><label for="onewayTrip">单程</label> </span>
									<span class="item"><input type="radio" value="2"
										name="flytype" id="roundTrip" autocomplete="off"><label
										for="roundTrip">往返</label> </span></td>
							</tr>
							<tr>
								<td>出发城市：</td>
								<td>
									<div class="qcbox qcity">
										<div class="boxWrapper">
											<div class="boxContainer" id="mainXI0">
												<div class="sinfo infotext" id="sinfoXI0" title="">城市名</div>
												<div class="sicon"></div>
												<div style="clear: both"></div>
											</div>
										</div>
										<input type="text" value="" name="fromCity" class="cinput"
											autocomplete="off">
										<div class="popContainer"></div>
									</div></td>
							</tr>
							<tr>
								<td>到达城市：</td>
								<td>
									<div class="qcbox qcity">
										<div class="boxWrapper">
											<div class="boxContainer" id="mainXI1">
												<div class="sinfo infotext" id="sinfoXI1" title="">城市名</div>
												<div class="sicon"></div>
												<div style="clear: both"></div>
											</div>
										</div>
										<input type="text" value="" name="toCity" class="cinput"
											autocomplete="off">
										<div class="popContainer"></div>
									</div></td>
							</tr>
							<tr>
								<td>出发日期：</td>
								<td>
									<div class="qcbox qdate fromD">
										<div class="boxWrapper">
											<div class="boxContainer" id="mainXI2">
												<div class="sinfo" id="sinfoXI2" title="">明天</div>
												<div class="sicon"></div>
												<div style="clear: both"></div>
											</div>
										</div>
										<input type="text" value="" name="fromDate" class="cinput"
											autocomplete="off">
										<div class="popContainer"></div>
									</div></td>
							</tr>
							<tr class="hide" id="rtDate">
								<td>返程日期：</td>
								<td>
									<div class="qcbox qdate toD">
										<div class="boxWrapper">
											<div class="boxContainer" id="mainXI3">
												<div class="sinfo" id="sinfoXI3" title="">周三</div>
												<div class="sicon"></div>
												<div style="clear: both"></div>
											</div>
										</div>
										<input type="text" value="" name="returnDate" class="cinput"
											autocomplete="off">
										<div class="popContainer"></div>
									</div></td>
							</tr>
							<tr>
								<th>&nbsp;</th>
								<td><input type="button" id="search" class="btn"
									value="搜 索">
								</td>
							</tr>
						</tbody>
					</table>
				</form>
			</div>
		</div>
		<div class="t_block helpct">
			<div class="hd">
				<div class="wrap2">帮助中心</div>
			</div>
			<div class="ct">
				<ul>
					<li><a href="/tts/help_booking.jsp">机票预订须知</a>
					</li>
					<li><a href="/tts/help_ticket.jsp">电子客票说明</a>
					</li>
					<li><a href="/tts/help_price.jsp">退票、更改和签转</a>
					</li>
					<li><a href="/tts/help_passport.jsp">去哪儿通行证</a>
					</li>
				</ul>
			</div>
		</div>
	</div>
	<div id="contentPanel" class="content">
		<div class="step step1"></div>
		<div id="flightListInfo">
			<div id="flightAirInfo" class="t_block2 finfo">
				<div class="hd">
					<div class="wrap">单程航班信息</div>
				</div>
				<div class="ct">
					<div id="faInfo">
						<div class="info">2012-03-12 星期一 共26个航班</div>
						<div class="line">广州→上海</div>
					</div>
					<div id="filterPanel" class="showonly">
						<div class="" id="filterXI44">
							<div class="filterList">
								<span style="float: left;">仅显示：</span><a href="#"
									style="float: left;" class="active" id="clearFilterXI44">全部</a><span><span><input
										type="radio" name="airName" value="CZ" class="filterInput"
										id="filterListXI45"><label for="filterListXI45"><a
											href="#nogo" name="airName" value="CZ"
											id="flinkfilterListXI45"><img align="absmiddle"
												src="http://source.qunar.com/site/images/airlines/small/CZ.gif">南方航空</a>
									</label> </span><span><input type="radio" name="airName" value="CA"
										class="filterInput" id="filterListXI46"><label
										for="filterListXI46"><a href="#nogo" name="airName"
											value="CA" id="flinkfilterListXI46"><img
												align="absmiddle"
												src="http://source.qunar.com/site/images/airlines/small/CA.gif">中国国航</a>
									</label> </span><span><input type="radio" name="airName" value="MU"
										class="filterInput" id="filterListXI47"><label
										for="filterListXI47"><a href="#nogo" name="airName"
											value="MU" id="flinkfilterListXI47"><img
												align="absmiddle"
												src="http://source.qunar.com/site/images/airlines/small/MU.gif">东方航空</a>
									</label> </span><span><input type="radio" name="airName" value="FM"
										class="filterInput" id="filterListXI48"><label
										for="filterListXI48"><a href="#nogo" name="airName"
											value="FM" id="flinkfilterListXI48"><img
												align="absmiddle"
												src="http://source.qunar.com/site/images/airlines/small/FM.gif">上海航空</a>
									</label> </span> </span>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div id="threeDay" class="fnav">
				<a
					href="http://tts.mtrip.net/site/onewaylist.htm?flytype=1&amp;fromCity=%E5%B9%BF%E5%B7%9E&amp;toCity=%E4%B8%8A%E6%B5%B7&amp;fromDate=2012-03-11&amp;returnDate=2012-03-15">&lt;-前一天</a>
				<a
					href="http://tts.mtrip.net/site/onewaylist.htm?flytype=1&amp;fromCity=%E5%B9%BF%E5%B7%9E&amp;toCity=%E4%B8%8A%E6%B5%B7&amp;fromDate=2012-03-13&amp;returnDate=2012-03-15">后一天-&gt;</a>
			</div>
			<div id="sortPanel" class="sorter">
				<span class="t">排序：</span><span class="item"><input
					type="radio" autocomplete="off" value="dt" id="orderbyprice"
					name="pxxxx" checked="checked"><label for="orderbyprice">价格</label>
				</span><span class="item"><input type="radio" autocomplete="off"
					value="pr" id="orderbytime" name="pxxxx"><label
					for="orderbytime">起飞时间</label> </span>
			</div>

			<div id="flightList" class="list">

				<div class="hd">
					<div class="c1">&nbsp;</div>
					<div class="c2">
						<strong>航空公司<br> 航班号</strong>
					</div>
					<div class="c3">
						<strong>起降时间</strong>
					</div>
					<div class="c4">
						<strong>起降机场</strong>
					</div>
					<div class="c5">
						<strong>价格 / 舱位</strong>
					</div>
					<div class="c6">
						<strong>退改签</strong>
					</div>
					<div class="c7">
						<div class="pop pop_ofee" id="afXI49">
							<strong>机建/燃油</strong>
							<div class="box aftips hide" id="aftipsXI49">
								<b class="arr"></b>
								<div class="inner">机场建设费 / 燃油附加税</div>
							</div>
						</div>
					</div>
					<div class="c8">
						<strong>备注</strong>
					</div>
				</div>
				<div style="z-index: 600" class="ct" id="flightListXI50">
					<div class="c1">
						<img
							src="http://source.qunar.com/site/images/airlines/small/CA.gif">
					</div>
					<div class="c2">
						中国国际航空公司<br> <strong><span class="s100030">2</span><span
							class="s100043">6</span><span class="s100047">7</span><span
							class="s100048">1</span><span class="s100049">5</span><span
							class="s10005">1</span><span class="s100053">8</span><span
							class="s100076">5</span><span class="s100081">C</span><span
							class="s100085">A</span><span class="s100087">6</span><span
							class="s100091">5</span> </strong>
						<!--<span class="planType">73G</span>-->
					</div>
					<div class="c3">
						<strong class="time1">07:50</strong><br> <strong
							class="time2">10:00</strong>
					</div>
					<div class="c4">
						白云机场<br> 浦东机场
					</div>
					<div class="c5">
						<div class="pr">
							¥<strong>900</strong>
						</div>
						<div class="pop_cp">/L舱</div>
					</div>
					<div class="c6">
						<div class="pop pop_is" id="tgqXI50">
							退改签
							<div class="box hide" id="tgqtipXI50">
								<b class="arr"></b>
								<div class="inner">
									更改条件:航班起飞前2小时之前取消定座，每次更改收取20%的改期费。航班起飞前2小时之内及航班起飞后取消定座，每次更改收取30%的改期费。<br>退票条件:航班起飞前2小时之前取消定座，收取30%的退票费。航班起飞前2小时之内及航班起飞后取消定座，收取40%的退票费。<br>签转条件:不得签转
									<div class="tip">退改签规定以航空公司最新标准为准。</div>
								</div>
							</div>
						</div>
					</div>
					<div class="c7">¥50/¥140</div>
					<div class="c8"></div>
					<div class="bb">
						<button class="btn" id="bookingXI50">预订</button>
						<a id="showflightListXI50" class="col" href="#">展开舱位</a>
					</div>
				</div>
				<!-- <div style="z-index: 99" class="ect">
					<div class="c1">&nbsp;</div>
					<div class="c2">&nbsp;</div>
					<div class="c3">&nbsp;</div>
					<div class="c4">&nbsp;</div>
					<div class="c5">
						<div class="pr">
							¥<strong>960</strong>
						</div>
						<div class="pop_cp">/K舱</div>
					</div>
					<div class="c6">
						<div class="pop pop_is" id="tgqXI51">
							退改签
							<div class="box hide" id="tgqtipXI51">
								<b class="arr"></b>
								<div class="inner">
									更改条件:航班起飞前2小时之前取消定座，客票有效期内免费更改。航班起飞前2小时之内及航班起飞后取消定座，每次更改收取10%的改期费。<br>退票条件:航班起飞前2小时之前取消定座，收取10%的退票费。航班起飞前2小时之内及航班起飞后取消定座，收取20%的退票费<br>签转条件:不得签转
									<div class="tip">退改签规定以航空公司最新标准为准。</div>
								</div>
							</div>
						</div>
					</div>
					<div class="c7">¥50/¥140</div>
					<div class="c8"></div>
					<div class="bb">
						<button class="btn" id="bookingBtnXI51">预订</button>
					</div>
				</div> -->
			</div>
			<div id="listPage">
				<div class="pager" id="pageXI95">
					<em>1</em> <a onclick="return false" href="#" id="pagelistXI97">2</a>
					<a onclick="return false" href="#" id="pagelistXI98">3</a> <a
						href="#" id="nextPageXI95">下一页</a>
				</div>
			</div>
		</div>
	</div>
</div>